﻿#include "excelexportthread.h"
#include <QDebug>

ExcelExportThread::ExcelExportThread(QObject *parent) : QThread(parent)
{

}

void ExcelExportThread::setFileName(QString fileName)
{
    this->fileName = fileName;
}

void ExcelExportThread::setExportData(QList<QList<QVariant>> data)
{
   this->m_datas = data;
}

void ExcelExportThread::run()
{
    if(m_xls.isNull())
        m_xls.reset(new ExcelBase);
    m_xls->create(fileName);
    m_xls->setCurrentSheet(1);
    m_xls->writeCurrentSheet(m_datas);
    m_xls->save();
    m_xls->close();
    emit exportDataDone();
}
